<template>
<div>
    <!-- {{ row.row_code }} -->
    <component
        :is="name"
        :name="name"
        :isEdit="isEdit"
        :row="row"
        @selectItem="selectItem"
        @update="update"
        @loadSuccess="loadSuccess"
    ></component>
</div>
</template>

<script>
// 这个组件是所有一级组件的容器组件，所有的一级组件都必须在这儿注册
export default {
    components: {
        header_base_info_1: () => import('./header_base_info_1'),
        header_base_info_2: () => import('./header_base_info_2'),
        header_base_info_3: () => import('./header_base_info_3'),
        header_base_info_4: () => import('./header_base_info_4'),
        header_base_info_5: () => import('./header_base_info_5'),
        header_base_info_6: () => import('./header_base_info_6'),
    },
    props: {
        isEdit: {
            type: Boolean,
            default: false,
        },
        name: {
            type: String,
            default: 'header_base_info_1',
        },
        row: {
            type: Object,
            default() {
                return {}
            },
        },
    },
    data() {
        return {
            page: this.name,
        }
    },
    watch: {
        name(val) {
            this.page = val
        },
    },
    methods: {
        selectItem() {
            this.$emit('selectItem', {
                name,
            })
        },
        update(row) {
            this.$emit('update', {
                ...row,
                first_stage_name: this.name,
            })
        },
        loadSuccess(row) {
            this.$emit('loadSuccess', row)
        },
    },
}
</script>

<style lang="scss" scoped></style>
